<%@ Page Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" ValidateRequest="false" AutoEventWireup="true" CodeFile="EditCompany.aspx.cs" Inherits="EditCompany" Title="Edit Company" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="FreeTextBox" Namespace="FreeTextBoxControls" TagPrefix="FTB" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderAdmin" Runat="Server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    
        <script type="text/javascript">
        function RowDblClick(sender, eventArgs)
        {
          sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
        }
        </script>
        
    <h3 id="title">Edit Company Information</h3>
    
    <h5>1.Configuration in detail :</h5>
    
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="ObjectDataSource1" GridLines="None" AllowAutomaticUpdates="True" Skin="Outlook">
        <MasterTableView AutoGenerateColumns="False" CellSpacing="-1" DataSourceID="ObjectDataSource1">
            <Columns>
                <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="CompanyID" DataType="System.Int32" HeaderText="CompanyID"
                    SortExpression="CompanyID" UniqueName="CompanyID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName"
                    UniqueName="CompanyName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description"
                    UniqueName="Description">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Address" HeaderText="Address" SortExpression="Address"
                    UniqueName="Address">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" SortExpression="Phone"
                    UniqueName="Phone">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Poster" HeaderText="Poster" SortExpression="Poster"
                    UniqueName="Poster">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings EditFormType="Template">
                <EditColumn UniqueName="EditCommandColumn1" ButtonType="PushButton" CancelText="iCancel" UpdateText="iUpdate"></EditColumn>
                <FormTemplate>
                        <table cellpadding="10px">
                            <tr>
                                <td>
                                    CompanyID : 
                                </td>
                                <td>
                                    <telerik:RadTextBox ID="CompanyID" runat="server" Text='<%# Bind("CompanyID") %>' ReadOnly="true" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    CompanyName : 
                                </td>
                                <td>
                                    <telerik:RadTextBox ID="CompanyName" runat="server" Text='<%# Bind("CompanyName") %>' Width="500px" />                                    
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Description : 
                                </td>
                                <td>
                                    <FTB:FreeTextBox ID="FreeTextBox1" runat="server" Text='<%# Bind("Description") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Address : 
                                </td>
                                <td>
                                    <telerik:RadTextBox ID="RadTextBox3" runat="server" Text='<%# Bind("Address") %>' Width="500px" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Phone : 
                                </td>
                                <td>
                                    <telerik:RadTextBox ID="RadTextBox4" runat="server" Text='<%# Bind("Phone") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Poster : 
                                </td>
                                <td visible="false">
                                    <telerik:RadTextBox ID="RadTextBox5" runat="server" Text='<%# Bind("Poster") %>' Width="500px" />
                                </td>
                            </tr>                                                                                                                                            
                            <tr>
                                <td colspan="2" align="center">
                                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                    </asp:Button>
                                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
                                </td>
                            </tr>                    
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>
    </telerik:RadGrid>
    
    <h5>2.Upload Company Image :</h5>
    <asp:Label ID="lblUploadMessage" runat="server" ForeColor="red" /><br />
    <telerik:RadUpload ID="upload" runat="server" MaxFileInputsCount="1" OverwriteExistingFiles="true" /><br />
    <asp:Button ID="btnUpload" runat="server" Text="Upload Your File" OnClick="btnUpload_Click" />
    
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="Entities.CompanyInfo" SelectMethod="GetAll" TypeName="Bll.CompanyBll" UpdateMethod="Update"></asp:ObjectDataSource>
</asp:Content>

